﻿@{
    ViewBag.Title = "流程管理";
    Layout = "~/Views/Shared/_FrameLayout.cshtml";
    string categoryId = Request["CategoryId"];
}
@section scripts
{


    <script>


        function formatterInstance(cellvalue, options, rowObject) {
            //return "<a style='color:red' href='/CustomerCertificate/CustomerAndCertificateReadOnlyView?id=" + rowObject.Id + "'>" + cellvalue + "</a>";
            return "<a style='color:red' href='#' onclick='openBusinessModel(\"" + rowObject.BusinessPath + "\")'>" + cellvalue + "</a>";
        }


        function openBusinessModel(businessPath) {
            top.layer.open({
                title: '业务数据',
                type: 2,
                content: businessPath,
                area: ['1000px', '700px'],
                cancel: function (index, layero) {
                    WikePage.ReLoadCurrentPage();
                    top.layer.close(index);
                }


            });
        }


        $(document).ready(function() {
            var config = {
                title: '流程管理',
                url: '@Url.Action("QueryWaitToDoList")?categoryId=@categoryId',
                colNames: ['主键', '实例名称', '创建人', '创建时间','所属类别','业务路径'],
                colModel: [
                    { name: 'Id', index: 'Id', width: 60, key: true, hidden: true },
                    { name: 'InstanceName', index: 'InstanceName', width: 30, formatter: formatterInstance },
                    { name: 'CreateUser', index: 'CreateUser', width: 30 },
                    { name: 'CreateTime', index: 'CreateTime', width: 30, formatter: 'date', formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } },
                    { name: 'CategoryName', index: 'CategoryName', width: 30  },
                    { name: 'BusinessPath', index: 'BusinessPath', width: 30,hidden:true }

                ],
                sortname: 'CreateTime',
                sortorder: "desc"
            };
            WikeGrid.Load(config);
        });
    </script>
}


<form id="searchToolBar" class="alert alert-info form-inline toolbarsearch" action="">
    <div class="form-group">
        <input type="text" id="keywords" name="keywords" autocomplete="off" class="form-control" placeholder="请输入关键字" />
    </div>
    <button class="btn btn-danger" id="btnSearch" type="button">
        <i class="fa menu-icon fa-cog "></i>查询
    </button>

</form>
<div class="jqGrid_wrapper">
    <table id="table_list"></table>
    <div id="pager_list"></div>
</div>